interface IPageData {
  inputValue: string;
  buttonLoading: boolean;
}

interface IPageInstance {
  data: IPageData;
  onInput(e: WechatMiniprogram.Input): void;
  onTapButton(): void;
}

Page<IPageData, IPageInstance>({
  data: {
    inputValue: '',
    buttonLoading: false
  },

  onInput(e) {
    this.setData({ inputValue: e.detail.value });
  },

  onTapButton() {
    this.setData({ buttonLoading: true });
    setTimeout(() => {
      this.setData({ buttonLoading: false });
    }, 2000);
  }
}); 